<template>
  <!--  <div class="ivu-card-head heard-box">-->
  <div class="heard-box">
    <div class="iconfont-custom-title">
     <div class="title-item">
       <el-icon color="#00D0A2"
                style="margin-right: 10px;">
         <Menu/>
       </el-icon>
       {{ name }}
     </div>
      <!--      <Iconfont :type="cIcon" border-radius color="#00D0A2" v-if="cIcon"-->
      <!--                style="margin-right:10px;"></Iconfont>-->
      <!--  标题    -->
      <div class="button-box">
        <slot name="buttons"></slot>
      </div>
    </div>
  </div>
</template>
<script>
import {mapMutations, mapGetters} from 'vuex';

export default {
  name: 'CommentHeader',
  props: {
    icon: {
      type: [String, Object],
      default: ''
    },//图标
    name: String,//标题
    isTool: {
      type: Boolean,
      default: false
    },
    treeLeft: {
      type: Boolean,
      default: () => {
        return false
      }
    },
    isSelectDown: {
      type: Boolean,
      default: () => {
        return false
      }
    },
    treeWidth: {
      type: Number,
      default: () => {
        return 0
      }
    },
    isSelectAll: {
      // 左树右表[本级/全部]开关显示控制
      type: Boolean,
      default: false
    },
    temId: {
      type: String
    },
    routeName: {
      type: String
    },
    outParams: {
      type: Object,
      default: () => {
        return {}
      }
    },
    routeBackURL: {
      type: String
    },
    colItem:{type:Object}
  },
  computed: {
    ...mapGetters(['isTableFullScreen']),
    cIcon() {
      let icon = this.icon;
      if (typeof icon === 'object') icon = icon.icon;
      return icon;
    },
  },
  data() {
    return {
      selectAll: true
    }
  },
  methods: {
    ...mapMutations(['SET_TABLE_FULLSCREEN', 'closeTag', 'DELETE_KEEPLIVE_DATA']),
    changeSelectDown() {
      this.$emit('select-down-change')
    },
    fullScreen() {
      this.SET_TABLE_FULLSCREEN(!this.isTableFullScreen)
    },
  },
  created() {
    this.selectAll = this.isSelectDown
    console.log('created',this.colItem)
  }
}
</script>
<style lang="less">
.iconfont-custom-title {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  .title-item{
    display: inline-flex;
    align-items: center;
  }
}

.heard-box {
  display: flex;
  border-bottom: 1px solid red;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  //position: absolute;
  .button-box {
    display: flex;
  }
}

.icon-card-lg {
  display: inline-block;
  width: 36px;
  height: 36px;
  background: #00D0A2;
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 36px;
  float: left;
  margin-right: 10px;
}

</style>
